﻿@{
    Ajax.Dna().Widget()
         .UserPreferences(@<text>
    <div>
        @Html.Global("RES_URL")</div>
    <div style="margin-top: 5px;">
        <table>
            <tr>
                <td>
                    @(Ajax.Dna().TextBox(item.GenerateFieldID("Url"))
          .Value(item.UserPreferences["Url"] != null ? item.GetString("Url") : "http://")
                .GetHtml()
            )
                </td>
                <td>
                    @Ajax.Dna().Button(item.GenerateFieldID("btnBrowseIcon")).LocText("RES_BROWSE").Click("$dna.fileDlg(\"" + Url.Action("Dialog", "WebFiles", new { Area = "", website = WebSiteContext.Current.Web.Name }) + "\",$(\"#" + item.GenerateFieldID("Url") + "\"));").ImageIcons(Url.Content("~/content/images/icon_folder_open_16.gif")).GetHtml()
                </td>
            </tr>
        </table>
    </div>
    <div>@Html.Global("RES_WIDTH")</div>
    <div>@Ajax.Dna().TextBox(item.GenerateFieldID("Width")).NumericOnly().Value(item.GetInt("Width")).GetHtml()</div>
    <div>@Html.Global("RES_HEIGHT")</div>
    <div>@Ajax.Dna().TextBox(item.GenerateFieldID("Height")).NumericOnly().Value(item.GetInt("Height")).GetHtml()</div>
    <p>
        @(
 Ajax.Dna().ComboBox(item.GenerateFieldID("uiMode")).Bind(new string[] { "invisible", "none", "mini", "full" })
    .Select(item.GetString("uiMode"))
    .GetHtml()
    )
    </p>
    <p>
        @( 
 Ajax.Dna().Checkbox(item.GenerateFieldID("mute"), Html.Global("tmpl", "Mute"), item.GetBool("mute"),
                            Url.Content(item.GetWidgetPath("images/mute.gif")),
                                   Url.Content(item.GetWidgetPath("images/volumn.gif")))
                           .GetHtml()
                           )</p>
    <p>
        @( 
 Ajax.Dna().Checkbox(item.GenerateFieldID("autoStart"), Html.Global("tmpl", "AutoStart"), item.GetBool("autoStart"),
                           Url.Content("~/content/images/icon_accept_16.png"),
                           Url.Content("~/content/images/icon_block_16.png"))
                           .GetHtml()
                           )
    </p>
    <p>
        @( 
 Ajax.Dna().Checkbox(item.GenerateFieldID("stretchToFit"), Html.Global("tmpl", "StretchToFit"), item.GetBool("stretchToFit"),
                           Url.Content("~/content/images/icon_accept_16.png"),
                           Url.Content("~/content/images/icon_block_16.png"))
                           .GetHtml()
                           )
    </p>
    <p>
        @( 
 Ajax.Dna().Checkbox(item.GenerateFieldID("enableContextMenu"), Html.Global("tmpl", "EnableContextMenu"), item.GetBool("enableContextMenu"),
                           Url.Content("~/content/images/icon_accept_16.png"),
                           Url.Content("~/content/images/icon_block_16.png"))
                           .GetHtml()
                           )
    </p>
    </text>)
        .Content(@<text>
    @if (!string.IsNullOrEmpty(item.GetString("Url")))
    {
        @Video.MediaPlayer(Url.Content(item.GetString("Url")), item.GetInt("Width").ToString() + "px", item.GetInt("Height").ToString() + "px",
        item.GetBool("autoStart"), 1, item.GetString("uiMode"), item.GetBool("stretchToFit"), item.GetBool("enableContextMenu")
        , item.GetBool("mute"));
    }
    </text>)
.Preview(@<text>
    @Video.MediaPlayer("http://sample.com/test.wmv", "360px")
    </text>)
        .Render();
}
